package com.teamwhole.modules.oa.facility.model;

public enum WorkOrderFacilityEnum {

	START("0", "工单创建"), 
	DISTRIBUTE("1", "工单派发"), 
	PROCESSING("2", "工单处理"), 
	AUDIT("3", "工单审核"), 
	DELAY("4", "工单延期"), 
	FINISH("5", "工单结束");
	
	private String code;
	private String name;

	public String getCode() {
		return code;
	}

	public String getName() {
		return name;
	}

	private WorkOrderFacilityEnum(String code, String name) {
		this.code = code;
		this.name = name;
	}

	@Override
	public String toString() {
		return this.name;
	}

	public static WorkOrderFacilityEnum getAdStatusEnum(String type) {
		switch (type) {
		case "0":
			return START;
		case "1":
			return DISTRIBUTE;
		case "2":
			return PROCESSING;
		case "3":
			return AUDIT;
		case "4":
			return DELAY;
		default:
			return FINISH;
		}
	}
	
}
